<!DOCTYPE html>
<html><head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        #chart-panel {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            padding: 10px 10px 20px 10px;
        }
    </style>
</head>
<body>
<div id="mapcontainer"></div>
 <style type="text/css">
		body, html,#mapcontainer {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
		#l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
		#r-result{height:100%;width:20%;float:left;}
</style>
<script type="text/javascript" src="//api.map.baidu.com/api?v=3.0&ak={$baiduak}"></script>  
<script type="text/javascript">
	var map = new BMap.Map("mapcontainer");
	var point = new BMap.Point(113.110042,23.052922);
	map.centerAndZoom(point, 5);
	map.enableScrollWheelZoom(true);
	
	var total={$totals};
	var lats=[];
	var lngs=[];
	var titles=[];
	{$mapstr}
	
	function addMarker(point,title){
		 var vectorMarker = new BMap.Marker(point, {
	  // 指定Marker的icon属性为Symbol
		  icon: new BMap.Symbol(BMap_Symbol_SHAPE_POINT, {
		    scale: 2,//图标缩放大小
		    fillColor: "orange",//填充颜色
		    fillOpacity: 0.8//填充透明度
		  })
		});
		//backgroundColor :"0.05",
		var label = new BMap.Label(title,{offset:new BMap.Size(20,-10)});
			label.setStyle({
				 color : "#ff6a08",
				 fontSize : "12px",
				 height : "20px",
				 lineHeight : "20px",
				 fontFamily:"微软雅黑",
				 backgroundColor :"0.05",
					border :"0"
			 });
			vectorMarker.setLabel(label);
		
			vectorMarker.addEventListener("click",pointClickEvent);
		
			map.addOverlay(vectorMarker);
	}
	
	function pointClickEvent(e){
		var p = e.target;
		var title='';
		for(var i in lngs){
			if(lngs[i]==p.getPosition().lng){
				title=titles[i];
				break;
			}
		}
		//alert("marker的位置是" + p.getPosition().lng + "," + p.getPosition().lat);    
		window.location.href="/admin/main/ShopPanorama?lng="+p.getPosition().lng+"&lat="+p.getPosition().lat+"&title="+title;
	}	



	for (var i = 0; i < total; i ++) {
		var point = new BMap.Point(lngs[i],lats[i]);
		addMarker(point,titles[i]);
	}
	
</script>    
</body>
</html>